The present invention relates to parsing instructions of a computer program and generating instructions that may be executed by a computer.
The use of networks is proliferating. As the use of networks increases, the dependency of network users upon networks increases, and the capability to manage networks becomes more critical. A key element to managing a network is network device management software, and in particular, the user interface through which the user interacts with the network device management software. Network device management software is software used to monitor and configure a particular network element. A network element is a computer system primarily dedicated to processing network traffic on a network. Network elements include network devices, such as routers, gateways, and switching devices.
A conventional user interface is a command line interface. A command line interface is a text based interface through which a user inputs keywords and other parameters. The keywords and other parameters represent commands in a computer language. The interface usually transmits the user inputted commands to the network element specified by the user, and in particular, to a process on the specified network element that decodes the commands and carries out the tasks indicated by the commands (xe2x80x9ccommand processorxe2x80x9d).
The commands that may be supported are numerous, and include commands for configuring a network element, or commands for retrieving information about the state of the particular network element. Examples of commands include a command for shutting down a port, a command for retrieving information about whether a port is operational, active or inactive. Each command may be associated with one or more arguments.
To set a property of a network element to a particular state, an instruction may be issued that specifies an argument value for a pre-determined argument of the command. Command names and the arguments are pre-defined in a grammar. The argument corresponds to the property; the value specifies the desired state for that property. For example, the following two lines each illustrate instructions that specify commands used to manage a network element. The commands conform to the Internetworking Operating System (IOS), an network operating system language provided by Cisco Systems, Incorporated, of San Jose, Calif.
interface ethernet 0
ip address 200.1.1.1. subnet 255.255.255.0
The two above instructions are issued to configure a particular port xe2x80x9c0xe2x80x9d as a particular port type, and to associated an IP (xe2x80x9cinternet protocolxe2x80x9d) address and a subnet mask to associate with the port.
Many command processors are configured to supply data specifying the state of a network element. The command processors communicate the state by generating and transmitting text output that is identical to text instructions that may be used to set the network element to that state. For example, in response to receiving the line below,
show running-config
a command processor outputs many lines of text including the following below:
. . .
interface ethernet 0
ip address=200.1.1.1 subnet=255.255.255.0
. . .
One advantage of the command line processor is that it may be run by any computer coupled to a network that is configured to run as a text-based or character terminal, such as workstations and personal computers that may run terminal emulators. A disadvantage of the command line interface is that it requires a user to know numerous commands, which may be cryptic, especially to a user whose use of the command line interface is intermittent. In addition, the command line interface is subject to other well known limitations. Lines of commands and responses scroll rapidly off the screen.
A mechanism that addresses the drawbacks of the command line interface is a graphical user interface (xe2x80x9cGUIxe2x80x9d). A GUI displays one or more windows with graphical controls, such as menus, list boxes, action buttons, and radio buttons. Many of the graphical controls are labeled. The graphical icons and labels communicate the current state of a network element, and how they may be manipulated to change the state of a network element. The GUI generates data indicating the properties to change and the new values for those properties. The GUI output is used to generate the instructions needed to effect the desired changes. Information to display within a GUI about a particular network element is generated from a command lines supplied by the network element to reflect its state. These command lines are parsed to extract information that is displayed in the GUI.
The set of commands a command processor processes is referred to as a command set. Command sets, and their syntaxes, vary between the command processors that reside on various types of network elements, including network elements from the same manufacturer. Thus, a GUI that is used with a set of network elements must be configured to interact with a variety of command sets. When it is desired to use a GUI with a new type of network element, the GUI may have to be reprogrammed. The cost of reprogramming new releases of the GUI and deploying the new releases, to keep pace with network elements and their new command sets, is a significant disadvantage.
Based on the foregoing, it is clearly desirably to provide a mechanism that parses command lines to extract information and that generates command lines from such information, and that may be easily and efficiently adapted to new command sets as they evolve.
The foregoing needs and objects, and other needs and objects that will become apparent from the following description, are achieved by the present invention, which comprises, in one aspect, a system for generically generating and parsing instructions to network elements. The system generates instructions from data that specifies values for attributes of those instructions, such as values for variables, and, conversely, generates attribute values for instructions from by parsing instructions. The mechanism uses syntax data that defines commands in a computer language. The same syntax data may be used to both generate instructions and to generate attribute values for instructions by parsing. In addition, the generated attribute values may be applied to syntax data describing commands in another computer language to produce instructions in the other computer language.